package org.example.controller;

import com.github.pagehelper.PageInfo;
import org.example.entity.PsyAss;
import org.example.service.PsyAssService;
import org.example.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName PsyAssController
 * @Description TODO
 * @Author lipeijin
 * @Date 2025年08月14日 下午3:19
 * @Version 1.0
 */
@RestController
@RequestMapping("PsyAss")
public class PsyAssController {
    @Autowired
    private PsyAssService psyService;
    @GetMapping
    public R getPage(@RequestParam(required = false,defaultValue = "1") int pageNum,
                     @RequestParam(required = false,defaultValue = "10") int PageSize){
        PageInfo<PsyAss> pageInfo = psyService.getPage(pageNum, PageSize);
        return R.ok(pageInfo);
    }

    @GetMapping("like")
    public R getlike(PsyAss psyAss,@RequestParam(required = false,defaultValue = "1") int pageNum,
                     @RequestParam(required = false,defaultValue = "10") int PageSize){
        PageInfo<PsyAss> psyAssPageInfo = psyService.selectPageName(psyAss, pageNum, PageSize);
        return R.ok(psyAssPageInfo);

    }
}
